﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.world.machines {
    import flash.events.*;
    import flash.display.*;
    import flash.geom.*;
    import net.wooga.pets.models.world.vos.actors.machines.*;
    import net.wooga.pets.constants.*;
    import net.wooga.pets.utils.*;

    public class ReceptionMachineMediator extends AbstractMachineMediator {

        override public function onRegister():void{
            super.onRegister();
            addContextListener(EventConstants.BUBBLE_CLOSED, this.onBubbleClosed);
            addContextListener(EventConstants.ON_COMPUTER_DISPLAY_HIDDEN, this.onCounterHidden);
            addContextListener(EventConstants.ADD_MORE_PETS_ARROW, this.addMorePetArrow);
            addContextListener(EventConstants.REMOVE_MORE_PETS_ARROW, this.removeMorePetArrow);
            this.addSecretaryAsset();
        }
        private function removeMorePetArrow(_arg1:Event):void{
            this.view.removeMorePetsArrow();
        }
        private function addMorePetArrow(_arg1:Event):void{
            var _local2:Point = new Point(130, -300);
            this.view.addMorePetsArrow("MorePetsArrow", languageModel.getTextByKey("reception_computer_arrow"), _local2);
        }
        private function addSecretaryAsset():void{
            var _local1:MovieClip = AssetsLibrary.getMovieClip("ReceptionSecretary");
            this.view.addSecretary(_local1);
        }
        private function get view():ReceptionMachineView{
            return ((viewComponent as ReceptionMachineView));
        }
        private function get vo():ReceptionMachineVO{
            return ((_vo as ReceptionMachineVO));
        }
        private function onBubbleClosed(_arg1:Event):void{
            if (this.vo.waitingForDiseaseBubbleToClose){
                this.vo.startReceptionTimer();
            };
        }
        private function onCounterHidden(_arg1:Event):void{
            dispatch(new Event(EventConstants.ENABLE_FRIENDS_MENU));
            this.vo.isOpen = false;
        }

    }
}//package net.wooga.pets.views.world.machines 
